Xceed Real-Time Zip for .NET Documentation
Xceed.Zip Assembly / Xceed.Zip.ReaderWriter Namespace / ZipWriter Class / WriteItemData Method / WriteItemData(Stream,Byte[],Int32,Int32) Method
A System.IO.Stream object.
An array of System.Byte to be used as the buffer in the data copy loop from itemData to ZipWriter.
The zero-based byte offset in buffer at which to begin copying bytes read from itemData.
The number of bytes to be copied to buffer in each loop iteration.


In This Topic
    WriteItemData(Stream,Byte[],Int32,Int32) Method
    In This Topic
    Writes the entire contents of a stream to the ZipWriter object's stream.
    Syntax
    'Declaration
     
    Public Overloads Function WriteItemData( _
       ByVal itemData As Stream, _
       ByVal buffer() As Byte, _
       ByVal offset As Integer, _
       ByVal count As Integer _
    ) As Long
    'Usage
     
    Dim instance As ZipWriter
    Dim itemData As Stream
    Dim buffer() As Byte
    Dim offset As Integer
    Dim count As Integer
    Dim value As Long
     
    value = instance.WriteItemData(itemData, buffer, offset, count)
    public long WriteItemData( 
       Stream itemData,
       byte[] buffer,
       int offset,
       int count
    )

    Parameters

    itemData
    A System.IO.Stream object.
    buffer
    An array of System.Byte to be used as the buffer in the data copy loop from itemData to ZipWriter.
    offset
    The zero-based byte offset in buffer at which to begin copying bytes read from itemData.
    count
    The number of bytes to be copied to buffer in each loop iteration.

    Return Value

    Returns the total amount of bytes read from the specified System.IO.Stream.
    Remarks

    This method allows you to supply your own buffer for the loop that drives the copy operation from the specified System.IO.Stream to ZipWriter. It prevents ZipWriter from allocating a temporary buffer to perform copy loop.

    The specified stream must support reading. It is not necessary for the stream to support seeking or writing. The specified stream is read to using the specified buffer until the end of the itemData is reached.

    The method does not close specified stream.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also